package com.myraff.viz;

public class Tools {
	
	private static String EXTENDED_MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-.";
	
	public static void main (String[] args) {
		int[] L = {341,621,3421,321};
		System.out.println(toExtendedFormat(L));
	}
	
	public static String toExtendedFormat(int i) {
		if (i < 0 || i > 4095)
			return null;
		else
			return new Character(EXTENDED_MAP.charAt(i/64)).toString() + EXTENDED_MAP.charAt(i%64);
	}
	
	public static String toExtendedFormat(int[] L) {
		String result = "";
		int len = L.length;
		for (int i=0; i<len; i++)
			result += toExtendedFormat(L[i]);
		
		return result;
	}
	
	public static int min(int[] L) {
		int min = L[0];
		int len = L.length;
		for (int i=1; i<len; i++)
			if (L[i] < min)
				min = L[i];
		return min;
	}
	
	public static int max(int[] L) {
		int max = L[0];
		int len = L.length;
		for (int i=1; i<len; i++)
			if (L[i] > max)
				max = L[i];
		return max;
	}

}
